package com.example.demoapi.api.controller;


import com.example.demoapi.api.pojo.Result;
import com.example.demoapi.api.service.DetailsServiceImpl;
import com.example.demoapi.api.service.WalletServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

/**
 * @author Hu
 * @date 2023/2/7
 * @apiNote
 */
@RestController
@RequestMapping("/user-select-info")
public class UserSelectInfoController {

    @Autowired
    private WalletServiceImpl walletService;

    @Autowired
    private DetailsServiceImpl detailsService;

    @RequestMapping("/queryUserBalance/{userId}")
    public BigDecimal queryUserBalance(@PathVariable("userId") int id) {
        return walletService.queryUserBalance(id);
    }

    @RequestMapping("queryUserInfo/{userId}")
    public Result queryUserInfo(@PathVariable("userId") int userId) {
        return detailsService.queryUserInfo(userId);
    }

}
